

<div>
  <a ng-click="openPlunkr('examples/example-example63')" class="btn pull-right">
    <i class="glyphicon glyphicon-edit">&nbsp;</i>
    Edit in Plunker</a>
  <div class="runnable-example"
      path="examples/example-example63"
      module="windowExample">

   
    <div class="runnable-example-file" 
      name="index.html"
      language="html"
      type="html">
      <pre><code>&lt;script&gt;&#10;  angular.module(&#39;windowExample&#39;, [])&#10;    .controller(&#39;ExampleController&#39;, [&#39;$scope&#39;, &#39;$window&#39;, function ($scope, $window) {&#10;      $scope.greeting = &#39;Hello, World!&#39;;&#10;      $scope.doGreeting = function(greeting) {&#10;        $window.alert(greeting);&#10;      };&#10;    }]);&#10;&lt;/script&gt;&#10;&lt;div ng-controller=&quot;ExampleController&quot;&gt;&#10;  &lt;input type=&quot;text&quot; ng-model=&quot;greeting&quot; /&gt;&#10;  &lt;button ng-click=&quot;doGreeting(greeting)&quot;&gt;ALERT&lt;/button&gt;&#10;&lt;/div&gt;</code></pre>
    </div>
  
    <div class="runnable-example-file" 
      name="protractor.js"
      type="protractor"
      language="js">
      <pre><code>it(&#39;should display the greeting in the input box&#39;, function() {&#10; element(by.model(&#39;greeting&#39;)).sendKeys(&#39;Hello, E2E Tests&#39;);&#10; // If we click the button it will block the test runner&#10; // element(&#39;:button&#39;).click();&#10;});</code></pre>
    </div>
  

    <iframe class="runnable-example-frame" src="examples/example-example63/index.html" name="example-example63"></iframe>
  </div>
</div>

;&#10;  $http.get(&quot;test_data.json&quot;, {cache: $templateCache}).success(function(userComments) {&#10;    self.userComments = userComments;&#10;  });&#10;  self.explicitlyTrustedHtml = $sce.trustAsHtml(&#10;      &#39;&lt;span onmouseover=&quot;this.textContent=&quot;Explicitly trusted HTML bypasses &#39; +&#10;      &#39;sanitization.&quot;&quot;&gt;Hover over this text.&lt;/span&gt;&#39;);&#10;});</code></pre>
    </div>
  
    <div class="runnable-example-file" 
      name="test_data.json"
      language="json"
      type="json">
      <pre><code>[&#10;{ &quot;name&quot;: &quot;Alice&quot;,&#10;  &quot;htmlComment&quot;:&#10;      &quot;&lt;span onmouseover=&#39;this.textContent=\&quot;PWN3D!\&quot;&#39;&gt;Is &lt;i&gt;anyone&lt;/i&gt; reading this?&lt;/span&gt;&quot;&#10;},&#10;{ &quot;name&quot;: &quot;Bob&quot;,&#10;  &quot;htmlComment&quot;: &quot;&lt;i&gt;Yes!&lt;/i&gt;  Am I the only other one?&quot;&#10;}&#10;]</code></pre>
    </div>
  
    <div class="runnable-example-file" 
      name="protractor.js"
      type="protractor"
      language="js">
      <pre><code>describe(&#39;SCE doc demo&#39;, function() {&#10;it(&#39;should sanitize untrusted values&#39;, function() {&#10;  expect(element.all(by.css(&#39;.htmlComment&#39;)).first().getInnerHtml())&#10;      .toBe(&#39;&lt;span&gt;Is &lt;i&gt;anyone&lt;/i&gt; reading this?&lt;/span&gt;&#39;);&#10;});&#10;&#10;it(&#39;should NOT sanitize explicitly trusted values&#39;, function() {&#10;  expect(element(by.id(&#39;explicitlyTrustedHtml&#39;)).getInnerHtml()).toBe(&#10;      &#39;&lt;span onmouseover=&quot;this.textContent=&quot;Explicitly trusted HTML bypasses &#39; +&#10;      &#39;sanitization.&quot;&quot;&gt;Hover over this text.&lt;/span&gt;&#39;);&#10;});&#10;});</code></pre>
    </div>
  

    <iframe class="runnable-example-frame" src="examples/example-example62/index.html" name="example-example62"></iframe>
  </div>
</div>

;StopFight&lt;/button&gt;&#10;  &lt;button type=&quot;button&quot; data-ng-click=&quot;resetFight()&quot;&gt;resetFight&lt;/button&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;</code></pre>
    </div>
  

    <iframe class="runnable-example-frame" src="examples/example-example60/index.html" name="example-example60"></iframe>
  </div>
</div>

39;,&#10;    function() {&#10;  invalidJsonpBtn.click();&#10;  fetchBtn.click();&#10;  expect(status.getText()).toMatch(&#39;0&#39;);&#10;  expect(data.getText()).toMatch(&#39;Request failed&#39;);&#10;});</code></pre>
    </div>
  

    <iframe class="runnable-example-frame" src="examples/example-example58/index.html" name="example-example58"></iframe>
  </div>
</div>

